﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AccountSite.Master"
    Inherits="System.Web.Mvc.ViewPage<Entity.Car_Rental.RentalRecord>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    在线订车
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="SiteMap" runat="server">
    <a href="/Home/Index">首页</a> &gt; 在线订车
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script src="../../Scripts/My97DatePicker4.7/WdatePicker.js" type="text/javascript"></script>
    <div class="modelTitle">
        &nbsp;&nbsp;设定行程
    </div>
    <%Html.RenderPartial("RetalFlow"); %>
    <%using (Html.BeginForm())
      {%>
    <%: Html.Hidden("ProductID", Request.QueryString["ProductID"])%>
    <%: Html.Hidden("Price", Request.QueryString["Price"])%>
    <%: Html.Hidden("ProductPropertyID", Request.QueryString["ProductPropertyID"])%>
    <%: Html.Hidden("isquene", Request.QueryString["isquene"])%>
    <div style="margin-bottom: 2px">
        <%: Html.ValidationSummary(true)%>
    </div>
    <div class="editor-label">
        取还车城市：
    </div>
    <div class="editor-field">
        <%=Html.AddressSelect() %>
    </div>
    <div class="clear">
    </div>
    <div class="editor-label">
        取还车门店：
    </div>
    <div class="editor-field">
        <%: Html.HiddenFor(m => m.ReturnShop, new { @class = "input" })%>
        <%:Html.TextBox("ReturnShopName",null, new { @class = "input" })%>
        <%: Html.ValidationMessageFor(m => m.ReturnShop)%>
        <a href="javascript:void(0)" onclick="ReplyFun()">选择门店</a>
    </div>
    <div class="clear">
    </div>
    <div class="editor-label">
        取车时间：
    </div>
    <div class="editor-field">
        <%=Html.TextBox("StartTime", DateTime.Now, new
{
    onfocus = "WdatePicker({isShowClear:false,dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:false})",
    style = "cursor: pointer",
    @class = "input"
})%>
        <%: Html.ValidationMessageFor(m => m.StartTime)%>
    </div>
    <div class="clear">
    </div>
    <div class="editor-label">
        还车时间：
    </div>
    <div class="editor-field">
        <%=Html.TextBox("EndTime", DateTime.Now.AddDays(1), new
{
    onfocus = "WdatePicker({isShowClear:false,dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:false})",
    style = "cursor: pointer",
    @class = "input"
})%>
        <%: Html.ValidationMessageFor(m => m.EndTime)%>
    </div>
    <div class="clear">
    </div>
    <input type="submit" class="button" value="下一步" id="rentalCarBtn" />
    <%} %>
    <div id="selshop" style="display: none">
        <%Html.RenderAction("ShopListByAreaID", "Shop", new { areaID = 11, page = 1 });%>
    </div>
    <script src="../../Scripts/rental.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.blockUI.js" type="text/javascript"></script>
    <script type="text/javascript">
        function selFun(id, name) {
            $("#ReturnShopName").val(name);
            $("#ReturnShop").val(id);
            blockClose();
            return false;
        }

        function ReplyFun() {
            $.blockUI({
                css: {
                    border: 0
                },
                overlayCSS: {
                    opacity: 0,
                    cursor: ''
                },
                message: $('#selshop')//页面中的ＤＩＶ的ＩＤ
            });
        }
        //对话框关闭
        function blockClose() {
            $.unblockUI();
        }
        $(function () {
            $("select").change(function () {
                var length = 2;
                if ($(this).attr("name") == "City")
                    length = 4;
                if ($(this).attr("name") == "District")
                    length = 6;
                $.ajax({
                    type: "GET",
                    data: { area: $(this).val(), length: length, page: 1 },
                    url: "/Shop/ShopListByAreaID",
                    success: function (data) {
                        $("#selshop").html(data);
                    }
                })
            });
        });

       
    </script>
</asp:Content>
